WildPackets COM Interface

Doc version 5.2.0.1

for AiroPeek/AiroPeek NX 2.0, EtherPeek 5.1, EtherPeek NX 2.1, and GigaPeek NX 1.0


Peek for Visual Basic: New COM Interface

Peek's COM interface now supports a few useful operations:

To specify a set of filters, use the Peek GUI to define them and save them as part of your capture template file.

To extract information out of a capture, save the capture to a file and then parse the file. Text packet lists are especially good for extracting summary strings and addresses.

Here's some Visual Basic sample code:

' acquire connection to app
Dim myApp
On Error Resume Next
myApp = GetObject(, "EtherPeek.Application")
If app Is Nothing Then
	myApp = CreateObject("EtherPeek.Application")
End If

' create  a new capture window, using an existing capture template
Dim myDoc
myDoc = myApp.Documents.Open("C:\foo\My Capture Template.ctf")

' start capture
myDoc.IsCapturing = True

' wait a while
' ...

' stop capture
myDoc.IsCapturing = False

' save the captured packets
myDoc.Save("C:\foo\My Saved Packet List.txt", 4)

COM Application Object Reference

Read-Only Properties
NameBSTRAiroPeek NX or AiroPeek
ApplicationIDispatch*the application object
ParentIDispatch*the application object
DocumentsIDispatch*the object that knows how to open documents
ActiveDocumentIDispatch*NULL (not implemented)
WindowsIDispatch*NULL (not implemented)
ActiveWindowIDispatch*NULL
FullNameBSTRsame as Name
PathBSTRempty string (not implemented)
Settable Properties
CaptionBSTRtitle of main window (usually AiroPeek NX)
InteractiveBOOLalways TRUE. Setting does nothing.
VisibleBOOLshows/hides the application
LeftLONGmoves the app window
TopLONGmoves the app window
WidthLONGresizes the app window
HeightLONGresizes the app window
MinimizedBOOLshrinks/expands the app window
MaximizedBOOLzooms/restores the app window
Methods
void Beep()makes noise
void Quit()exits the app
void Minimize()shrinks the app. Same as setting Minimized = True
void Maximize()zooms the app. Same as setting Maximized = True
void Restore()makes the app a movable window
void CloseAll()closes all open windows
void CascadeWindows()stacks all open windows
void TileVertically()tall skinny windows
void TileHorizontally()short wide windows
void ArrangeIcons()rearranges deck chairs on your MDI Titanic
void NextWindow()flips to the next open window
void PreviousWindow()flips to the previous open window
void ViewFilters()opens Filters window
void ViewNameTable()opens Name Table window
void ViewLog()opens Log window
void ViewAlarms()opens Alarms window

COM Documents Object Reference

The Documents object exists only to open files. All other properties and methods are unimplemented.

Method
IDispatch* Open(BSTR File)Opens the given file. If the given file is a packet trace file, returns an IDispatch* reference to the Document object that file window. If the file is a capture template file, returns an IDispatch* reference to the Document object for that capture window.

COM Document Object Reference

The Document class represents a capture or file window. You acquire a reference to a document object through app.Documents.Open(BSTR File).

Read-Only Properties
ApplicationIDispatch*NULL (not implemented)
ParentIDispatch*NULL (not implemented)
NameBSTRwindow title
Settable Properties
IsCapturingBOOLset to True to start capture, set to False to stop capture
Methods
void Close()Closes the window
void Save(BSTR FilePath, INT formatIndex)Saves all packets to a file. format index is the index into the format combo box in Peek's Save dialog:
  1. .apc/.pkt Peek Packet File (new tagged format)
  2. .apc/.pkt Peek Classic Packet File
  3. .wpz Peek Packet File Compressed
  4. .txt Packet List (tab delimited)
  5. .csv Packet List (comma separated value)
  6. .txt Decoded Packets
  7. .rtf Decoded Packets
  8. .htm Decoded Packets

WildPackets, Inc.
1340 Treat Blvd., Suite 500
Walnut Creek, CA 94597 USA
(925) 937-3200
http://www.wildpackets.com/
sdkhelp@wildpackets.com


Copyright © 2001-2003 WildPackets, Inc.
All rights reserved.